package com.atguigu.spzx.order.mapper;

import com.atguigu.spzx.model.entity.order.OrderInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface OrderInfoMapper {
    void save(OrderInfo orderInfo);

    OrderInfo findOrderById(Long id);

    List<OrderInfo> findPageByStatus(@Param("orderStatus") Integer orderStatus,
                                     @Param("userId") Long userId);

    OrderInfo findOrderByOrderNo(Long orderNo);
    @Update("UPDATE order_info SET pay_type = 2 , order_status = 1 , payment_time = now() " +
            "WHERE is_deleted = 0 AND order_no = #{orderNo}")
    void updateOrderPayStatus(String orderNo);
}
